﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@using MVC.Models;
@using MVC.Models.Database;
@{
    var data_ = ViewData["cheng"] as List<Information>;
}

<body>
    <style>
        * {
            margin: 0;
            padding: 0
        }
    </style>
    <!--导航栏-->
    <div class="content">

        <div id="main">
            <ul id="main_ul">
                @{
                    if (data_ != null)
                        for (int  j = 0; j < data_.Count;  j++)
                        {
                            <li >
                                <a href="detail.html?id=@data_[j].Id">
                                    <img src="@data_[j].Picture">
                                    <p>@data_[j].Title</p>
                                    <p>
                                        @data_[j].Content
                                    </p>
                                    <p>发布时间:@data_[j].Date</p>
                                    <p>文章来源:@data_[j].From</p>
                                </a>
                            </li>
                        }
                }
            </ul>
        </div>

        <div class="paging" style="margin-top:10px">
            <ul class="pagination" data-classname="@ViewData["ClassName"]">
                @{
                    for (var i = 1; i <= Convert.ToInt32(ViewData["row"]); i++)
                    {
                        <li><a class="active" href="javascript:update(@i)">@i</a></li>
                    }
                }

            </ul>
        </div>
    </div>

    <script>
        function update(i) {
            window.location.href = "index.html?pages=" + i  + "&ClassName=" + $(".pagination").data().classname;
        }
    </script>
</body>

